﻿<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Script file="Models.lua" />
  <Frame name="AOSSControlsModels" inherits="AOSSPanelTemplate">
    <Size>
      <AbsDimension x="400" y="400"/>
    </Size>
    <Anchors>
      <Anchor point="TOPLEFT" />
    </Anchors>
    <Frames>
      <SimpleHTML name="ModelsSimpleHTML" inherits="ControlsSimpleHTMLTemplate" file="Interface\AddOns\AddOnStudioSamples\Controls\Models.html" >
        <Scripts>
          <OnHyperlinkClick>
            assert(loadstring(link))()
          </OnHyperlinkClick>
        </Scripts>
      </SimpleHTML>      
    </Frames>
    <Scripts>
      <OnLoad>
        AOSSControlsModels_OnLoad(self)
      </OnLoad>
    </Scripts>
  </Frame>

  <Frame name="ExampleCharacterModelFrame" hidden="true" frameStrata="DIALOG" movable="true" enableMouse="true">
    <Size>
      <AbsDimension x="400" y="440" />
    </Size>
    <Anchors>
      <Anchor point="CENTER">        
      </Anchor>
    </Anchors>
    <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
      <BackgroundInsets>
        <AbsInset left="11" right="12" top="12" bottom="11" />
      </BackgroundInsets>
      <TileSize>
        <AbsValue val="32" />
      </TileSize>
      <EdgeSize>
        <AbsValue val="32" />
      </EdgeSize>
    </Backdrop>
    <Frames>
      <PlayerModel name="ExampleCharacterModel" >
        <Size>
          <AbsDimension x="400" y="400"/>
        </Size>
        <Anchors>
          <Anchor point="BOTTOM">
          </Anchor>
        </Anchors>        
        <Scripts>
          <OnLoad>
            self:SetUnit("player");
            Model_OnLoad(self);
            --self:RegisterEvent("DISPLAY_SIZE_CHANGED");
          </OnLoad>
          <OnShow>
            self:SetUnit("player");
            self:SetScale(0.99);
          </OnShow>
          <OnEvent>
            self:RefreshUnit();
          </OnEvent>
          <OnUpdate>
            Model_OnUpdate(self, elapsed);
          </OnUpdate>
        </Scripts>        
      </PlayerModel>
      <Button name="ExampleCharacterModelFrameCloseButton" inherits="UIPanelCloseButton">
        <Anchors>
          <Anchor point="TOPRIGHT" >
            <Offset x="-4" y ="-4" />
          </Anchor>
        </Anchors>
      </Button>
      <Button name="ExampleCharacterModelRotateLeftButton">
        <Size>
          <AbsDimension x="35" y="35"/>
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT" >
            <Offset x="6" y ="-6" />
          </Anchor>
        </Anchors>
        <Scripts>
          <OnClick>
            Model_RotateLeft(ExampleCharacterModel);
          </OnClick>
        </Scripts>
        <NormalTexture file="Interface\Buttons\UI-RotationLeft-Button-Up"/>
        <PushedTexture file="Interface\Buttons\UI-RotationLeft-Button-Down"/>
        <HighlightTexture file="Interface\Buttons\ButtonHilight-Round" alphaMode="ADD"/>
      </Button>
      <Button name="ExampleCharacterModelRotateRightButton">
        <Size>
          <AbsDimension x="35" y="35"/>
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="ExampleCharacterModelRotateLeftButton" relativePoint="TOPRIGHT"/>
        </Anchors>
        <Scripts>
          <OnClick>
            Model_RotateRight(ExampleCharacterModel);
          </OnClick>
        </Scripts>
        <NormalTexture file="Interface\Buttons\UI-RotationRight-Button-Up"/>
        <PushedTexture file="Interface\Buttons\UI-RotationRight-Button-Down"/>
        <HighlightTexture file="Interface\Buttons\ButtonHilight-Round" alphaMode="ADD"/>
      </Button>
    </Frames>
    <Scripts>
      <OnLoad>self:RegisterForDrag("LeftButton");</OnLoad>
      <OnDragStart>self:StartMoving();</OnDragStart>
      <OnDragStop>self:StopMovingOrSizing();</OnDragStop>
    </Scripts>
  </Frame>
    
</Ui>